<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ include file="/system/include/taglib.jsp"%>
<html>
<head>
<base href="${pageScope.basePath }">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>中山市中凯信息科技有限公司</title>
<link type="text/css" rel="stylesheet" href="system/css/style.css" />
<script type="text/javascript" src="system/js/jquery-1.4.2.js"></script>
<script type="text/javascript" src="system/js/userlist.js"></script>
<script type="text/javascript" src="system/js/public.js"></script>
<script type="text/javascript">
function mod(uid){
	location.href="${pageScope.basePath }system/config/user_manage_modify.jsp?userId="+uid;
}

function del(id){
	if(confirm("确定要删除该用户吗?")){
		location.href="${pageScope.basePath }system/config/user_manage_delete.do?userId="+id;
	}
}
</script>
</head>
<body>
<div class="main">
	<div class="position">当前位置: <a href="sysadm/desktop.jsp">桌 面</a> → 用户管理</div>
	<div class="mainbody">
		<div class="operate_info">
			操作说明：
			<font color="#FF0000"><label id="explaininfo">&nbsp;</label></font>
		</div>
		<div class="table">
			<table width="100%" border="0" cellpadding="1" cellspacing="1" class="table_list">
				<tr>
					<th width="50">ID</th>
					<th>用户编号</th>
					<th>用户名</th>
					<th >用户昵称</th>
					<th>角色</th>
					<th>部门</th>
					<th>启用状态</th>
					<th>邮箱</th>
					<th>操作</th>
				</tr>
				<mytag:List table="User" name="userList" orderBy="userId desc" pageMax="10" ></mytag:List>
				<logic:notEmpty name="userList">
					<logic:iterate id="user" name="userList">
					<mytag:View table="com.zhongkai.model.config.Department" id="${user.departmentId}" name="department"></mytag:View>
						<tr onMouseOver="mouseOver(this)" onMouseOut="mouseOut(this)">
							<td>${user.userId }</td>
							<td>${user.userIdentifier}</td>
							<td>${user.userAccount }</td>
							<td>${user.userNickname }</td>
							<td>
								<mytag:List field="roleName" name="roleList" table="Role">roleId in (${user.roleId })</mytag:List>
								<logic:iterate id="role" name="roleList" indexId="roleIndex">
									<c:if test="${roleIndex!=0 }">,</c:if>
									${role}
								</logic:iterate>
							</td>
							<td>${department.departmentName}</td>
							<td>
								<c:if test="${user.userSwitch==0 }">禁用</c:if>
								<c:if test="${user.userSwitch==1 }">启用</c:if>
							</td>
							<td>${user.userEmail }</td>
							<td>
								<input type="button" value="修改" class="system_button" onclick="mod(${user.userId})"/>
								<input type="button" value="删除" class="system_button" onclick="del(${user.userId})"/>
							</td>
						</tr>
					</logic:iterate>
					</logic:notEmpty>
				<logic:empty name="userList">
					<tr>
						<td colspan="9">暂无记录</td>
					</tr>
				</logic:empty>
				<tr>
					<td colspan="9" class="page" style="padding-top:10px;"><mytag:page /></td>
				</tr>
			</table>
		</div>
	</div>
</div>
</body>
</html>
